<!--鉴定结构-->
<template>
  <div id="DangerousAppraisalNew">
    <div class="top">
      <!--{{row.NODE_GUID}}-->
      <img
        style="margin: 0 auto"
        class="imgtop"
        src="https://nfzjszlb.jst.zj.gov.cn/serverfile/zheliban/icon/ZLJ/fgx2.png"
      />
      <!--<img v-else style="margin: 0 auto" class="imgtop"-->
      <!--src="https://nfzjszlb.jst.zj.gov.cn/serverfile/zheliban/icon/ZLJ/fgx.png" />-->
      <p>
        <span style="width: 125px; display: inline-block; text-align: left">危房鉴定</span>
        <span style="width: 150px;display: inline-block;text-align: right">复核鉴定</span>
      </p>
    </div>
    <div class="content">
      <van-form validate-first :class="{ smallFontSize: showEdition, mediumFontSize: !showEdition }">
        <div class="inputWrap">
          <van-field
            readonly
            v-model="row.propertyPerson"
            placeholder="请输入户主姓名"
            label="户主姓名"
            :rules="[{ required: true, message: '请填写户主姓名' }]"
          />
        </div>
        <div class="inputWrap">
          <van-field
            readonly
            v-model="row.householderIdCard"
            label="身份证号码"
            name="validator"
            @blur.native.capture="handleGetCityData"
            placeholder="身份证号码"
            :rules="[{ validator, message: '请输入正确身份证号码' }]"
          />
        </div>
        <div class="inputWrap">
          <van-field
            readonly
            placeholder="请输入手机号码"
            v-model="row.householderPhone"
            label="手机号"
            :rules="[
              { required: true, message: '请填写您的手机号码！' },
              { pattern: /^1[3456789]\d{9}$/, message: '手机号码格式错误！' },
            ]"
            name="pattern"
          />
        </div>
        <div class="inputWrap">
          <van-field
            readonly
            clickable
            name="picker"
            :value="row.belongCity"
            label="所属市"
            placeholder="请选择所属市"
            :rules="[{ required: true, message: '请选择所属市' }]"
          />
        </div>
        <div class="inputWrap">
          <van-field
            readonly
            clickable
            name="picker"
            :value="row.belongCountry"
            label="所属县(区)"
            placeholder="请选择所属县(区)"
          />
        </div>
        <div class="inputWrap">
          <van-field
            readonly
            clickable
            name="picker"
            :value="row.belongTown"
            label="所属镇"
            placeholder="请选择所属镇"
          />
        </div>
        <div class="inputWrap">
          <van-field
            readonly
            clickable
            name="picker"
            :value="row.belongVillage"
            label="所属村"
            placeholder="请选择所属村"
          />
        </div>
        <div class="inputWrap">
          <van-field readonly v-model="row.detailAddress" label="房屋地址" placeholder="请输入房屋地址" />
        </div>
        <div class="inputWrap">
          <van-field readonly v-model="row.buildFloor" type="number" label="建筑层数" placeholder="请输入建筑层数" /> 层
        </div>
        <div class="inputWrap">
          <van-field readonly v-model="row.buildYear" label="建造年份" placeholder="请输入建造年份" />
        </div>
        <div class="inputWrap">
          <van-field readonly v-model="authenticateInfo.companyName" label="鉴定机构" placeholder="请输入鉴定机构" />
        </div>
      </van-form>
      <p class="subTitle"><span class="line"></span>鉴定信息</p>
      <van-form validate-first :class="{ smallFontSize: showEdition, mediumFontSize: !showEdition }">
        <div class="inputWrap">
          <span style="color: #FF0000;">*</span>
          <van-field clickable readonly :value="authenticateInfo.appraiseType | inUseName(ENUM.FWLXARR)" label="房屋用途"
                     placeholder="请选择房屋用途" @click="ENUM.JDLX = true" />
          <van-popup v-model="ENUM.JDLX" position="bottom" get-container="#popup">
            <van-picker show-toolbar :columns="ENUM.FWLXARR" value-key="DICNAME" @confirm="confirmJDLX"
                        @cancel="ENUM.JDLX = false" />
          </van-popup>
        </div>
        <div class="inputWrap">
          <span style="color: #ff0000">*</span>
          <van-field v-model="authenticateInfo.appraiseNo" label="鉴定报告编号" placeholder="请输入鉴定报告编号" />
          <span @click="getJDBH" class="btn-style1"> 获取鉴定编号</span>
        </div>
        <div class="inputWrap">
          <span style="color: #ff0000">*</span>
          <van-field
            clickable
            readonly
            :value="authenticateInfo.appraiseLevel | inUseName(ENUM.JDDJARR)"
            label="鉴定等级"
            placeholder="请选择鉴定等级"
            @click="ENUM.JDDJ = true"
          />
          <van-popup v-model="ENUM.JDDJ" position="bottom" get-container="#popup">
            <van-picker
              show-toolbar
              :columns="ENUM.JDDJARR"
              value-key="DICNAME"
              @confirm="confirmJDDJ"
              @cancel="ENUM.JDDJ = false"
            />
          </van-popup>
        </div>
        <div class="inputWrap">
          <span style="color: #ff0000">*</span>
          <van-field
            readonly
            clickable
            name="datetimePicker"
            v-model="authenticateInfo.appraiseDate"
            label="鉴定时间"
            placeholder="请选择鉴定时间"
            @click="showPickerq = true"
          />
          <van-popup v-model="showPickerq" position="bottom" get-container="#popup">
            <van-datetime-picker
              v-model="currentDate"
              type="date"
              title="选择年月日"
              @cancel="showPickerq = false"
              @confirm="onConfirm"
            />
          </van-popup>
        </div>
        <div class="inputWrap">
          <span style="color: #ff0000">*</span>
          <van-field label="上传人" v-model="authenticateInfo.createUser" placeholder="请输入上传人" />
        </div>
        <p class="title">治理意见</p>
        <div class="inputWrap">
          <van-field v-model="authenticateInfo.resolveOption" autosize type="textarea" placeholder="请输入治理意见" />
        </div>
        <p class="title">备注</p>
        <div class="inputWrap">
          <van-field v-model="authenticateInfo.comments" autosize type="textarea" placeholder="请输入备注" label />
        </div>
      </van-form>
      <CheckeRgisterNew v-if="row.processNum==5" :row="row" ref="CheckeRgisterNew" :rowDataNew="CheckeRgisterNew" />
      <JDJGPDFNew  v-if="row.processNum==5"  :row="row" :rowDataNew="JDJGPDFNew" ref="JDJGPDFNew" />
      <div v-for="(item, index) in ImgData" :key="index + 'ImgData'">
        <div v-if="item.isPDF" style="margin-bottom:8px">
          <p style="font-size: 14px">
          {{ item.name }}
        </p>
        <van-uploader
          style="margin-top:8px"
          @click-upload="getList(item)"
          :after-read="afterRead"
          :before-delete="delectFile"
          v-model="item.fileList"
          multiple
        />
        </div>
        <div v-else style="margin-bottom:8px">
          <p style="font-size: 14px">
          {{ item.name }}
        </p>
        <van-uploader
        v-if="!isAndroid"
        accept=".pdf"
        style="margin-top:8px"
        :before-delete="delectFile"
          v-model="item.fileList" :after-read="afterRead" @click-upload="getList(item)"
        >
          <van-button type="info">上传文件</van-button>
        </van-uploader>
        <van-uploader
        v-else
        style="margin-top:8px"
        accept=""
        :before-delete="delectFile"
          v-model="item.fileList" :after-read="afterRead" @click-upload="getList(item)"
        >
          <van-button type="info">上传文件</van-button>
        </van-uploader>
        </div>
      </div>
    </div>
    <div class="footer">
      <van-button @click="saveData" type="info">保存</van-button>
      <van-button @click="saveData('submit')" type="info">提交</van-button>
    </div>
  </div>
</template>

<script>
import {
  ossUploadFiles,
  uploadFileBiz,
  dangerHouseProcessremoldAuth,
  dangerHousesavegetAllAuthInfo,
  dangerHousesaveUpdateAllAuthInfo,
  QuerySignCallback,
  dataServerOpenDataView,
  GetFileData,
  FileServerUpload,
  DelectFile,
  getNum,
  ossdelteFiles,
  dataTransFilePreview,
  FileServerProxy,
  numGenerateGetNum
} from '@/utils/api'
import JDJGPDFNew from '@/components/ZLJ/JDJGPDFNew' //鉴定公司基本信息
import CheckeRgisterNew from './CheckeRgisterNew' //农村房屋结构安全排查登记表
export default {
  name: 'DangerousAppraisalNew',
  data() {
    return {
      CCITYNAME: '',
      isAndroid:false,
      showEdition: false,
      row: {},
      rowDataNew: {},
      CheckeRgisterNew: {},
      JDJGPDFNew: {},
      baseUrl: window.g.BaseURL,
      rowGuid: '',
      dataguid: '9788c08d-3d96-4f0d-85da-d233094abcf6',
      formData: {
        CS: '',
        NF: '',
        SCITY: '',
        XCITY: '',
        ZCITY: '',
        CCITY: '',
        JDLX: '',
        JDDJ: '',
        JDSJ: '',
        BZ: '',
        JDBGBH: '',
        OPTYPE: 1,
        SCR: '',
        FWDZ: '',
        JDJG: '',
      },
      //存图片上传
      photo1:[],
      photo2:[],
      authenticateInfo: {
        appraiseType:1,
        appraiseNo: '',
        appraiseLevel: '',
        appraiseDate: '',
        createUser: '',
        comments: '',
        companyName: '',
        companyUscc: '',
        objectNo: '',
        resolveOption:"",
        fileHousePicture: '',
        fileReport: '',
        fileReportUrlList:[],
        fileHousePictureUrlList:[]
      },
      currentDate: new Date(),
      CityColumns: [],
      XianColumns: [],
      TownColumns: [],
      CunColumns: [],
      showPickerq: false,
      isAdd: true,
      ENUM: {
        FWLXARR: [
          {
            DICNAME: '自住',
            DICID: 1,
          },
          {
            DICNAME: '生产经营',
            DICID: 2,
          },
          {
            DICNAME: '公共用房',
            DICID: 3,
          }
        ],
        JDLX: false,
        JDDJARR: [
          {
            DICNAME: 'A级',
            DICID: 'A',
          },
          {
            DICNAME: 'B级',
            DICID: 'B',
          },
          {
            DICNAME: 'C级',
            DICID: 'C',
          },
          {
            DICNAME: 'D级',
            DICID: 'D',
          },
        ],
        JDDJ: false,
      },
      ImgData: [
        {
          name: '房屋照片',
          groupGuid: '8188d4d5-0898-44b9-b7f9-4f84dfb58f11',
          fileList: [],
          isPDF:true
        },
        {
          name: '鉴定报告(pdf)',
          groupGuid: '88d711ba-870c-40f2-a81d-71df8caeefd4',
          fileList: [],
          isPDF:false
        }

      ],
      // file2: [
      //   {
      //     name: '鉴定报告',
      //     groupGuid: '88d711ba-870c-40f2-a81d-71df8caeefd4',
      //     fileList: []
      //   },
      //   {
      //     name: '房屋照片改造前',
      //     groupGuid: 'd46b2463-896b-4fff-9ad1-48ae7cbc7c9c',
      //     fileList: []
      //   },
      //   {
      //     name: '房屋照片改造后',
      //     groupGuid: 'c96cca59-db53-4626-b608-9fa007b37e8a',
      //     fileList: []
      //   }
      // ]
    }
  },
  components: {
    JDJGPDFNew,
    CheckeRgisterNew,
  },
  watch: {},
  filters: {
    inUseName: function (msg, data) {
      let name = ''
      data.forEach((item) => {
        if (item.DICID == msg) {
          name = item.DICNAME
        }
      })
      return name
    },
    inUseName1: function (msg, data) {
      let name = ''
      data.forEach((item) => {
        if (item.CITYCODE == msg) {
          name = item.CITYNAME
        }
      })
      return name
    },
  },
  methods: {
    onConfirm(val) {
      this.showPickerq = false
      this.authenticateInfo.appraiseDate = this.formatGetDate(val)
    },
    formatGetDate(val) {
      let year = val.getFullYear()
      let month = val.getMonth() + 1
      let day = val.getDate()
      let hour = val.getHours()
      let minute = val.getMinutes()
      let second = val.getSeconds()
      if (month >= 1 && month <= 9) {
        month = `0${month}`
      }
      if (day >= 1 && day <= 9) {
        day = `0${day}`
      }
      if (hour >= 0 && hour <= 9) {
        hour = `0${hour}`
      }
      if (minute >= 0 && minute <= 9) {
        minute = `0${minute}`
      }
      if (second >= 0 && second <= 9) {
        second = `0${second}`
      }
      let data = `${year}-${month}-${day} ${hour}:${minute}:${second}`
      return data
    },
    validator(val) {
      var idcardReg =
        /^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$|^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/
      return idcardReg.test(val)
    },
    confirmJDLX(val) {
      this.authenticateInfo.appraiseType = val.DICID
      this.authenticateInfo.JDLX = val.DICID
      this.ENUM.JDLX = false
    },
    confirmJDDJ(val) {
      this.authenticateInfo.appraiseLevel = val.DICID
      this.authenticateInfo.JDDJ = val.DICID
      this.ENUM.JDDJ = false
    },
    //获取相关材料
    getFile: async function () {
      this.ImgData.forEach((item) => {
        switch (item) {
          case '鉴定报告(pdf)':
            item.fileList.push({
              url: this.baseUrl + 'api/upload/oss/preview?fileId=' + this.authenticateInfo.fileReport,
              isImage: false,
            })
            break
          case '房屋照片':
            item.fileList.push({
              url: this.baseUrl + 'api/upload/oss/preview?fileId=' + this.authenticateInfo.fileHousePicture,
              isImage: true,
            })
            break
        }
      })
      console.log(this.authenticateInfo, 'xiaohe')
    },
    //相关材料
    afterRead(file) {
      // 此时可以自行将文件上传至服务器
      // this.getFileServerUpload(file.file);
      if (Array.isArray(file)) {
        file.forEach((item, index) => {
          this.getFileServerUpload(item.file)
        })
      } else {
        this.getFileServerUpload(file.file)
      }
    },
    blobToImg(blob) {
      return new Promise((resolve, reject) => {
        //
        let reader = new FileReader()
        reader.addEventListener('load', () => {
          let img = new Image()
          img.src = reader.result
          img.addEventListener('load', () => resolve(img))
        })
        reader.readAsDataURL(blob)
      })
    },
    getList(item) {
      this.groupGuids = item.groupGuid
      this.groupName = item.name
    },
    getFileServerUpload: async function (file) {
      debugger
      let formData = new FormData()
      formData.append('files', file)
      formData.append('path', 'wg')
      formData.append('groupName', this.groupName)
      formData.append('toGroupGuid', this.groupGuids)
      const res = await ossUploadFiles(formData)
      if (res.data.data) {
        if(this.groupName=="房屋照片"){
          this.authenticateInfo.fileHousePicture=this.groupGuids;
        }
        if(this.groupName=="鉴定报告(pdf)"){
          this.authenticateInfo.fileReport=this.groupGuids;
        }
        this.$toast.success('上传成功!')
      }else{
        this.$toast.fail(res.data.msg)
      }
    },
    delectFile: async function (file) {
      debugger
      let arr = [];
      arr.push(file.id);
      let webResult=await ossdelteFiles(arr);
      if(webResult.data.data){
        this.$toast.success('删除成功!')
      }else{
        this.$toast.fail('删除成功!')
      }
    },
    //获取鉴定编号
    getJDBH:async  function(){
      debugger
      let params= {
        appKey: "6738b790-69e8-11ec-a673-6805cab640z1",
        accessCode: "b03be941dc27498ebcc46311330ee97d",
        keyType: '0',
        numPrefix: "JDBH",
        year: new Date().getFullYear(), //当前年份
      }
      const res = await numGenerateGetNum(params)
      if(res.data&&res.data.data){
        this.authenticateInfo.appraiseNo=res.data.data;
      }else{
        this.authenticateInfo.appraiseNo="";
      }
    },
    //获取附件文件流
    getFileUrl: async function (element, item) {
      // let formData = new FormData();
      // formData.append("accessCode", "98bcf528966e48ce896a8b3fd02d45d5");
      // formData.append(
      //   "cityCode",
      //   window.localStorage.getItem("citycode")
      //     ? window.localStorage.getItem("citycode")
      //     : "441300000000"
      // );
      // formData.append(
      //   "paramStr",
      //   JSON.stringify({
      //     fileGuid: element.ROW_GUID,
      //   })
      // );
      // let response = await dataTransFilePreview(formData);
      // if (response) {
      //   var img = new Blob([new Int8Array(response.data, 0)], {
      //     type: response.headers["content-type"],
      //   }); //type类型可自定义
      //   element["isImage"] = true;
      //   element["url"] = window.URL.createObjectURL(img);
      //   item.fileList.push(element);
      // }
      this.fileList.push({
        url: this.baseUrl + 'api/upload/oss/preview?fileId=' + data1,
        isImage: true,
      })
    },
    //
    lookFile(item) {
      if (itme.isImage == false) {
        // if (ZWJSBridge) {
        ZWJSBridge.openLink({
          url: item.url,
        })
          .then((res) => {})
          .catch((err) => {
            window.open(item.url)
          })
        // }
      }
    },
    getinsertDataView: async function (data) {
      //提交
      //判断有没有鉴定报告
      if(this.ImgData&&(this.ImgData[0].fileList.length==0 || this.ImgData[1].fileList.length==0)){
        this.$toast.fail("请上传房屋照片、鉴定报告!");
        return;
      }
      debugger
      var p = {
        appraiseLevel: 'A',
        appraiseNo: this.authenticateInfo.appraiseNo,
        appraiseType: this.authenticateInfo.appraiseType ? this.authenticateInfo.appraiseType : 0,
        comments: this.authenticateInfo.comments,
        companyName: this.authenticateInfo.companyName,
        companyUscc: this.authenticateInfo.companyUscc,
        createUser: this.authenticateInfo.createUser,
        "resolveOption": this.authenticateInfo.resolveOption,
        fileHousePicture: this.authenticateInfo.fileHousePicture,
        fileReport: this.authenticateInfo.fileReport,
        fwid: '',
        userName:this.authenticateInfo.companyName?this.authenticateInfo.companyName: window.localStorage.getItem('DanDianName'),
        objectNo: this.row.objectNo,
      }
      const res = await dangerHouseProcessremoldAuth(p)
      if (res && res.data.code == '200') {
        this.$toast.success('提交成功!')
        this.$router.push({
          path: '/MyAgentSNew',
          query:{data:JSON.stringify(this.list),city:JSON.stringify(this.city)}
        })
      } else {
        this.$toast.fail(res.data.msg)
      }
    },
    saveData: async function (type) {
      let houseRemoldAuthRecordForm = {};
      let houseRemoldAuthSituation = {};
      if(this.row&&this.row.processNum==5){
        this.$refs.CheckeRgisterNew.houseRemoldAuthRecordForm.objectNo = this.row.objectNo
        this.$refs.JDJGPDFNew.houseRemoldAuthSituation.objectNo = this.row.objectNo
        houseRemoldAuthRecordForm = this.$refs.CheckeRgisterNew.houseRemoldAuthRecordForm
        houseRemoldAuthSituation = this.$refs.JDJGPDFNew.houseRemoldAuthSituation
      }
      this.authenticateInfo.objectNo=this.row.objectNo;
      var param = {
        authenticateInfo: this.authenticateInfo,
        houseRemoldAuthRecordForm: houseRemoldAuthRecordForm,
        houseRemoldAuthSituation: houseRemoldAuthSituation,
        objectNo: this.row.objectNo,
      }
      const res = await dangerHousesaveUpdateAllAuthInfo(param)
      if (res.data.code == '200') {
        if (type == 'submit') {
          this.getinsertDataView()
        } else {
          this.$toast.success('保存成功!')
        }
      } else {
        this.$toast.fail('保存失败！')
      }
      console.log(res)
    },
    getData: async function () {
      //获取数据
      debugger
      var p = {
        authCompanyName: this.row.companyName,
        objectNo: this.row.objectNo,
        uscc: '', //this.row.uscc
      }
      const res = await dangerHousesavegetAllAuthInfo(p)
      console.log(res)
      if (res && res.data) {
        if (res.data.data.authenticateInfo) {
          this.authenticateInfo = res.data.data.authenticateInfo
          if (res.data.data.authenticateInfo&&res.data.data.authenticateInfo.fileHousePicture) {
            this.ImgData[0].groupGuid = res.data.data.authenticateInfo.fileHousePicture
          } else {
            this.ImgData[0].groupGuid = this.newGuid()
            //生成新的id存进对应的字段中
            res.data.data.authenticateInfo.fileHousePicture = this.ImgData[0].groupGuid
          }
          if (res.data.data.authenticateInfo&&res.data.data.authenticateInfo.fileReport) {
            this.ImgData[1].groupGuid = res.data.data.authenticateInfo.fileReport
          } else {
            this.ImgData[1].groupGuid = this.newGuid()
            this.authenticateInfo.fileReport = this.ImgData[1].groupGuid
          }
          if (res.data.data.authenticateInfo&&res.data.data.authenticateInfo.fileHousePictureUrlList&&res.data.data.authenticateInfo.fileHousePictureUrlList.length > 0) {
            this.ImgData[0].fileList=[];
            res.data.data.authenticateInfo.fileHousePictureUrlList.forEach((item,index)=>{
              if(window.g.IsEnabled=="0"){
                this.ImgData[0].fileList.push(
                  {
                    url: window.g.BaseURL+"api/upload/oss/preview?fileId=" + item.id,
                    isImage: true,
                    id:item.id,
                    name: item.fileName,
                  }
                )
              }else{
                this.ImgData[0].fileList.push(
                  {
                    url: window.g.OSSPriview+item.fileUrl,
                    isImage: true,
                    id:item.id,
                    name: item.fileName,
                  }
                )
              }
            })
          }
          if (res.data.data.authenticateInfo&&res.data.data.authenticateInfo.fileReportUrlList&&res.data.data.authenticateInfo.fileReportUrlList.length > 0) {
            this.ImgData[1].fileList=[];
            res.data.data.authenticateInfo.fileReportUrlList.forEach((item,index)=>{
              if(window.g.IsEnabled=="0"){
                this.ImgData[1].fileList.push(
                  {
                    url: window.g.BaseURL+"api/upload/oss/preview?fileId=" + item.id,
                    isImage: false,
                    id:item.id,
                    name: item.fileName,
                  }
                )
              }else{
                this.ImgData[1].fileList.push(
                  {
                    url: window.g.OSSPriview+item.fileUrl,
                    isImage: false,
                    id:item.id,
                    name: item.fileName,
                  }
                )
              }
            })
          }
          //
          // if(this.authenticateInfo.fileHousePicture){
          //     this.ImgData[0].groupGuid = this.authenticateInfo.fileHousePicture
          //     this.authenticateInfo.fileHousePictureUrlList.forEach(item=>{
          //         this.ImgData[0].fileList.push({
          //             url: window.g.BaseURL4+item.fileUrl+'?download=0',
          //             isImage: true
          //         })
          //     })
          // }else{
          //     let guid = this.newGuid();
          //     this.authenticateInfo.fileHousePicture = guid;
          //     this.ImgData[0].groupGuid = guid;
          // }
          // if(this.authenticateInfo.fileReport){
          //     this.ImgData[1].groupGuid = this.authenticateInfo.fileReport;
          //     this.authenticateInfo.fileReportUrlList.forEach(item=>{
          //         this.ImgData[1].fileList.push({
          //             url: window.g.BaseURL4+item.fileUrl+'?download=0',
          //             isImage: true
          //         })
          //     })
          // }else{
          //     let guid = this.newGuid();
          //     this.authenticateInfo.fileReport = guid;
          //     this.ImgData[1].groupGuid = guid;
          // }
        }
        if (res.data.data.houseRemoldAuthSituation) {
          this.JDJGPDFNew = res.data.data.houseRemoldAuthSituation
        }
        if(res.data.data.houseRemoldAuthRecordForm){
          this.CheckeRgisterNew = res.data.data.houseRemoldAuthRecordForm
        }
      }
    },
    PreviewReport() {
      let groupGuid = '',
        dataGuid = ''
      if (
        this.row.NODE_GUID === '{27EE0E9F-607B-4D25-8934-3693F950C095}' ||
        this.row.NODE_GUID === '{7A93D2DC-D4B9-4E6A-8DC6-4C2FDFBB9D45}'
      ) {
        groupGuid = '{AE32F4B0-ED78-4C30-B894-F52A5ABA912B}'
        dataGuid = '005d990a-3c77-46b3-9e6a-6ec5ed33b24c'
      } else {
        groupGuid = '{4CD6F0FC-AC91-430B-B838-70DBABE0F603}'
        dataGuid = '005d990a-3c77-46b3-9e6a-6ec5ed33b24c'
      }
      if (this.row.WF_GUID == '{AFA7FC7F-BDBD-46EA-ABD2-EEF0766096D2}') {
        dataGuid = '57a43986-96ca-4da0-a44e-7e4610927bce'
      }
      let baseurl = this.row.URL.replace(/#/g, ':')
      let url =
        baseurl +
        'PrintServer/api/PreviewWordRpt?groupGuid=' +
        groupGuid +
        '&toRowGuid=' +
        this.row.ROW_GUID +
        '&dataGuid=' +
        dataGuid
      let url1 = window.g.BaseURL + '/api/farmerHouse/proxy/dataTransFile/v2?fileUrl=' + encodeURIComponent(url)
      this.$router.push({
        path: './viewPDF',
        query: {
          data: url1,
        },
      })
    },
  },
  mounted() {
    debugger
    this.isAndroid = window.sessionStorage.getItem('isAndroid')
    if(this.$route.query&&this.$route.query.list){
      this.list=JSON.parse(this.$route.query.list);
      this.city=JSON.parse(this.$route.query.city);
      this.authenticateInfo.companyName=this.list.companyName;
    }
    if(this.$route.query&&this.$route.query.data){
      this.row = JSON.parse(this.$route.query.data)
    }


    // this.authenticateInfo.appraiseDate = this.getDate(true);

    // this.authenticateInfo.companyUscc="913301857471537181"
    this.getData()
    this.showEdition = this.$store.state.Edition
    if (this.showEdition) {
      $('#DangerousAppraisalNew .van-field__control').css('fontSize', '16px !important')
      $('#DangerousAppraisalNew .van-cell').css('fontSize', '16px !important')
    } else {
      $('#DangerousAppraisalNew .van-field__control').css('fontSize', '20px !important')
      $('#DangerousAppraisalNew .van-cell').css('fontSize', '20px !important')
    }
    //  this.getNumData(this.row.TYSHXYDM)
    if (ZWJSBridge) {
      ZWJSBridge.setTitle({
        title: '鉴定公司',
      })
        .then((res) => {})
        .catch((err) => {})
    }
  },
}
</script>
<style scoped lang="scss">
#DangerousAppraisalNew {
  height: 100vh;
  .top {
    height: 80px;
    background: #ffffff;
    padding-top: 25px;
    text-align: center;

    .imgtop {
      width: 60%;
      margin: 0 auto;
    }

    .origin {
      width: 22px;
      height: 22px;
      background: #007aff;
      border-radius: 50%;
      display: inline-block;
    }
  }
  .btn-style1{
    width: 80px;
    height: 30px;
    background: #EFF6FF;
    border-radius: 4px;
    float: right;
    margin-top: 5px;
    display: inline-block;
    text-align: center;
    line-height: 30px;
    font-size: 14px;
    color: #007AFF;
  }
  .content {
    width: 100%;
    height: calc(100% - 140px);
    overflow: auto;
    background: #ffffff;
    padding: 10px;

    .subTitle {
      color: #3f8ffc;
      height: 40px;
      line-height: 40px;
      font-size: 16px;
      //   .line {
      //     width: 6px;
      //     height: 26px;
      //     background: #3f8ffc;
      //     display: inline-block;
      //     margin-right: 10px;
      //   }
    }

    .title {
      color: black;
      font-size: 16px;
      line-height: 40px;
    }

    .inputWrap {
      display: flex;
      justify-content: center;
      align-items: center;
      border-bottom: 1px solid #d2d2d2;
    }

    .van-cell {
      padding: 10px 0;
    }
  }

  .footer {
    padding: 10px;
    text-align: center;

    .bottomBtn {
      min-width: 20%;
      height: 40px;
      background: #007aff;
      line-height: 40px;
      text-align: center;
      color: #ffffff;
      font-weight: bold;
      float: left;
      margin-right: 10px;
      padding: 0 10px;
    }
  }
}
</style>
<style lang="scss">
#DangerousAppraisalNew {
  .van-field__label {
    width: auto !important;
  }

  .mediumFontSize {
    .van-field__label {
      font-size: 20px;
    }
  }

  .el-input__inner {
    /*font-size: 16px;*/
    text-align: right;
    border: none;
  }

  .van-cell:not(:last-child)::after {
    left: 0;
    // border-bottom: 1px solid rgb(210, 210, 210);
  }

  .van-cell::after {
    border-bottom: none;
  }

  .van-cell {
    padding: 10px 0;
    font-size: 16px;
  }

  .van-field__control {
    text-align: right;
  }

  textarea {
    text-align: left !important;
  }

  .van-field__label {
    color: black !important;
    letter-spacing: 1px;
  }

  .van-cell {
    color: black;
  }
}
</style>

